﻿<UserControl x:Class="SoftTeach.View.Noten.ArbeitNotenlistePrintView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:scm="clr-namespace:System.ComponentModel;assembly=WindowsBase"
             mc:Ignorable="d" d:DesignWidth="750" d:DesignHeight="300">
  <UserControl.Resources>
    <CollectionViewSource x:Key="SortedSchüler" Source="{Binding Schülereinträge}">
      <CollectionViewSource.SortDescriptions>
        <scm:SortDescription PropertyName="SchülereintragPerson.PersonNachname" Direction="Ascending" />
        <scm:SortDescription PropertyName="SchülereintragPerson.PersonVorname" Direction="Ascending" />
      </CollectionViewSource.SortDescriptions>
    </CollectionViewSource>
  </UserControl.Resources>
  <Grid Margin="60,60">
    <Grid.RowDefinitions>
      <RowDefinition Height="Auto"/>
      <RowDefinition Height="Auto"/>
      <RowDefinition Height="Auto"/>
      <RowDefinition Height="Auto"/>
    </Grid.RowDefinitions>
    <Grid Grid.Row="0" Margin="5">
      <Grid.ColumnDefinitions>
        <ColumnDefinition Width="*"/>
        <ColumnDefinition Width="Auto"/>
      </Grid.ColumnDefinitions>
      <Label Grid.Row="0" Style="{StaticResource StundenentwurfPrintHeaderLabelBold}" Content="{Binding Path=NotenlisteTitel, Mode=OneWay}"/>
    </Grid>
    <GroupBox Grid.Row="1" Header="Notenspiegel" Padding="5">
      <Grid  VerticalAlignment="Center">
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="20"/>
          <ColumnDefinition Width="Auto"/>
          <ColumnDefinition Width="30"/>
          <ColumnDefinition Width="Auto"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
          <RowDefinition Height="Auto"/>
          <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <Grid Grid.Column="1" Grid.RowSpan="2" Background="WhiteSmoke">
          <Grid.ColumnDefinitions>
            <ColumnDefinition Width="20"/>
            <ColumnDefinition Width="1"/>
            <ColumnDefinition Width="20"/>
            <ColumnDefinition Width="1"/>
            <ColumnDefinition Width="20"/>
            <ColumnDefinition Width="1"/>
            <ColumnDefinition Width="20"/>
            <ColumnDefinition Width="1"/>
            <ColumnDefinition Width="20"/>
            <ColumnDefinition Width="1"/>
            <ColumnDefinition Width="20"/>
          </Grid.ColumnDefinitions>
          <Grid.RowDefinitions>
            <RowDefinition Height="25"/>
            <RowDefinition Height="1"/>
            <RowDefinition Height="25"/>
          </Grid.RowDefinitions>
          <Label Grid.Row="0" Grid.Column="0" Style="{StaticResource NotenschnittStyle}">1</Label>
          <Border Grid.Row="0" Grid.Column="1" Grid.RowSpan="3" BorderBrush="DarkGray" BorderThickness="1"/>
          <Label Grid.Row="0" Grid.Column="2" Style="{StaticResource NotenschnittStyle}">2</Label>
          <Border Grid.Row="0" Grid.Column="3" Grid.RowSpan="3" BorderBrush="DarkGray" BorderThickness="1"/>
          <Label Grid.Row="0" Grid.Column="4" Style="{StaticResource NotenschnittStyle}">3</Label>
          <Border Grid.Row="0" Grid.Column="5" Grid.RowSpan="3" BorderBrush="DarkGray" BorderThickness="1"/>
          <Label Grid.Row="0" Grid.Column="6" Style="{StaticResource NotenschnittStyle}">4</Label>
          <Border Grid.Row="0" Grid.Column="7" Grid.RowSpan="3" BorderBrush="DarkGray" BorderThickness="1"/>
          <Label Grid.Row="0" Grid.Column="8" Style="{StaticResource NotenschnittStyle}">5</Label>
          <Border Grid.Row="0" Grid.Column="9" Grid.RowSpan="3" BorderBrush="DarkGray" BorderThickness="1"/>
          <Label Grid.Row="0" Grid.Column="10" Style="{StaticResource NotenschnittStyle}">6</Label>
          <Border Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="11" BorderBrush="DarkGray" BorderThickness="1"/>
          <Label Grid.Row="2" Grid.Column="0" Style="{StaticResource NotenschnittStyle}" Content="{Binding Path=ArbeitAnzahlNoten1}"/>
          <Label Grid.Row="2" Grid.Column="2" Style="{StaticResource NotenschnittStyle}" Content="{Binding Path=ArbeitAnzahlNoten2}"/>
          <Label Grid.Row="2" Grid.Column="4" Style="{StaticResource NotenschnittStyle}" Content="{Binding Path=ArbeitAnzahlNoten3}"/>
          <Label Grid.Row="2" Grid.Column="6" Style="{StaticResource NotenschnittStyle}" Content="{Binding Path=ArbeitAnzahlNoten4}"/>
          <Label Grid.Row="2" Grid.Column="8" Style="{StaticResource NotenschnittStyle}" Content="{Binding Path=ArbeitAnzahlNoten5}"/>
          <Label Grid.Row="2" Grid.Column="10" Style="{StaticResource NotenschnittStyle}" Content="{Binding Path=ArbeitAnzahlNoten6}"/>
        </Grid>
        <Label Grid.Column="3" Grid.Row="1" Content="{Binding Path=ArbeitNotendurchschnittString}"/>
      </Grid>
    </GroupBox>
    <DataGrid Grid.Row="2" Margin="5"
              Style="{StaticResource DatagridPrintStyle}"
              ItemsSource="{Binding Source={StaticResource SortedSchüler}}"
              IsReadOnly="True"
              AutoGenerateColumns="False"
              RowDetailsVisibilityMode="Collapsed" 
              HorizontalScrollBarVisibility="Disabled" 
              VerticalScrollBarVisibility="Disabled"
              HeadersVisibility="Column"
              ColumnHeaderStyle="{StaticResource NotenColumnHeaderPrintStyle}"
              >
      <DataGrid.Columns>
        <DataGridTextColumn Header="Nachname" Binding="{Binding Path=SchülereintragPerson.PersonNachname}" Width="180"/>
        <DataGridTextColumn Header="Vorname" Binding="{Binding Path=SchülereintragPerson.PersonVorname}" Width="180"/>
        <DataGridTextColumn Header="" Width="93"/>
        <DataGridTextColumn Header="Punkte" Binding="{Binding Path=CurrentArbeitPunktsumme}" Width="70" CellStyle="{StaticResource CenteredCellPrintStyle}"/>
        <DataGridTextColumn Header="Prozent" Binding="{Binding Path=CurrentArbeitProzentsatz}" Width="70" CellStyle="{StaticResource CenteredCellPrintStyle}"/>
        <DataGridTextColumn Header="Note" Binding="{Binding Path=CurrentArbeitNote}" Width="70" CellStyle="{StaticResource CenteredCellPrintStyle}"/>
      </DataGrid.Columns>
    </DataGrid>
  </Grid>
</UserControl>
